﻿using System;
using System.Collections.ObjectModel;
using Asistente.Managers;
using Asistente.Model.General;

namespace Asistente.Model.Representation
{
	public abstract class Panel : Element, IElement
	{
		public String Name { get; set; }        
		private Collection<Control> controls;
		public Collection<Control> Controls
		{
			get { return controls; }
			set { controls = value;  }
		}
	 
		public Panel() { controls = new Collection<Control>();  }

		
		public Control NewControl(ControlPattern pattern, int quantity)
		{
			var control = new Control
								  {
									  Name = Numerator.Instance.GetName(typeof(Control)),
									  ControlPattern = pattern,
									  Quantity = quantity
								  };

			Controls.Add(control);
			return control;
		}
		
		public Control NewControl()
		{
			var control = new Control();
			control.Name = Numerator.Instance.GetName(control.GetType());
			control.Quantity = 1;
			Controls.Add(control);
			return control;
		}

        public abstract Panel Clone();
	    
	
	}
}
